package info.motteke.qjdbc.column.variable;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public final class StringVariable extends Variable {

    private String value = null;

    public StringVariable() {

    }

    public StringVariable(String value) {
        is(value);
    }

    public void is(String value) {
        this.value = value;
    }

    @Override
    void putValue(PreparedStatement pstmt, int index) throws SQLException {
        if (value == null) {
            throw new IllegalStateException();
        }
        pstmt.setString(index, value);
    }

}
